import cloud from "@tbmp/mp-cloud-sdk";
cloud.init({
  // env: "online"
  env: "pre"
  // env: "test"
});

App({
  cloud,
  globalData:{
    innerAudioContext:"",
  },
  onLaunch(options) {
    // 第一次打开
    // options.query == {number:1}
    console.info('App onLaunch');

     my.alert({
      content:"开始"
    })

    let _this = this

    _this.globalData.innerAudioContext = my.createInnerAudioContext()
    _this.globalData.innerAudioContext.loop = true
    _this.globalData.innerAudioContext.src = 'sucai/BackgroundMusic.mp3'

    _this.globalData.innerAudioContext.play();

    // if(this.play == undefined || this.play == true){
    //   _this.globalData.innerAudioContext.play()
    // }

    // if(this.play == false){
    //   _this.globalData.innerAudioContext.pause()
    // }
    
  },

  // onLoad(){

   

  // },
  
  onShow(options) {

    // 从后台被 scheme 重新打开
    // options.query == {number:1}

    my.alert({
      content:this.play
    })
    
    // if(this.play == undefined || this.play == true){
    //   _this.globalData.innerAudioContext.play()
    // }

    // if(this.play == false){
    //   _this.globalData.innerAudioContext.pause()
    // }

     
  },
});

